﻿using System;
using Netkk.Common.Models;

namespace Netkk.Models
{
    public class ContentModel
    {
        public string Name { get; set; }
        public string PageTitle { get; set; }
        public string PageDescription { get; set; }
        public string PageKeywords { get; set; }
        public string PageContent { get; set; }
        public bool ShowEditLink { get; set; }

        public static ContentModel Create()
        {
            return new ContentModel
                       {
                           Name = String.Empty,
                           PageContent = String.Empty,
                           PageDescription = String.Empty,
                           PageKeywords = String.Empty,
                           PageTitle = String.Empty
                       };
        }
        public static ContentModel Create(string name)
        {
            return new ContentModel
            {
                Name = name,
                PageContent = String.Empty,
                PageDescription = String.Empty,
                PageKeywords = String.Empty,
                PageTitle = String.Empty
            };
        }
        public static ContentModel Create(Content content)
        {
            return new ContentModel
            {
                Name = content.Name,
                PageContent = content.PageContent,
                PageDescription = content.PageDescription,
                PageKeywords = content.PageKeywords,
                PageTitle = content.PageTitle
            };
        }

        public Content ToContent()
        {
            return new Content
                       {
                           Name = Name,
                           PageContent = PageContent,
                           PageDescription = PageDescription,
                           PageKeywords = PageKeywords,
                           PageTitle = PageTitle
                       };
        }
    }
}
